import { globalUserId , zuulToken } from "./constants.ts";
import Cookies from "js-cookie";

//判断是否是登录成功状态
const isLogin = () => {
  if (getToken()) return true;
  return false;
}

// 获取zuulToken
const getToken = () => {
  return Cookies.get(zuulToken);
}

// 获取globalUserId
const getUserId = () => {
  return Cookies.get(globalUserId);
}

// 删除zuulToken
const removeToken = () => {
  return Cookies.remove(zuulToken);
}
// 删除globalUserId
const removeUserId = () => {
  return Cookies.remove(globalUserId);
}

export {
  isLogin,
  getToken,
  getUserId,
  removeToken,
  removeUserId
}